#ifndef IMAGE_LOADER_H_INCLUDED
#define IMAGE_LOADER_H_INCLUDED

#include <windows.h>
#include "gl\gl.h"

using namespace std;

typedef struct
{
	int width;
	int height;
	GLubyte *data;
} Image;

typedef struct tagPCXHEADER
{
	unsigned char	manufacturer;		// manufacturer
	unsigned char	version;			// version
	unsigned char	encoding;			// encoding type
	unsigned char	bitsPerPixel;		// number of bits per pixel

	unsigned short	x, y;
	unsigned short	width, height;		// dimensions
	unsigned short	horzRes, vertRes;	// horizontal and vertical screen resolutions

	unsigned char	*palette;			// color palette
	unsigned char	reserved;			// reserved
	unsigned char	numColorPlanes;		// number of planes

	unsigned short	bytesPerScanLine;	// byte per line
	unsigned short	paletteType;		// palette type
	unsigned short	horzSize, vertSize;

	unsigned char	padding[54];

} PCXHEADER, *PPCXHEADER;

//reads a bitmap image from file
Image* loadBMP(const char* filename);
//reads a pcx file
Image *loadPCX(const char *filename);
//Makes the image into a texture, and returns the id of the texture
GLuint loadTexture(Image *image);

#endif //IMAGE_LOADER_H_INCLUDED
